{#
/*
 * This file is part of the ProductReview plugin
 *
 * Copyright (C) 2016 LOCKON CO.,LTD. All Rights Reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
#}
{#
[商品管理]-[商品レビュー]-[編集]画面
#}

{% extends '@admin/default_frame.twig' %}

{% set menus = ['product', 'product_review'] %}

{% block title %}{{ 'product_review.admin.product_review_edit.title'|trans }}{% endblock %}
{% block sub_title %}{{ 'product_review.admin.product_review_edit.sub_title'|trans }}{% endblock %}

{% form_theme form '@admin/Form/bootstrap_4_horizontal_layout.html.twig' %}

{% block main %}

    <form role="form" method="post"
          action="{{ url('product_review_admin_product_review_edit', { id : ProductReview.id }) }}">
        {{ form_widget(form._token) }}
        <div class="c-contentsArea__cols">
            <div class="c-contentsArea__primaryCol">
                <div class="c-primaryCol">
                    <div class="card rounded border-0 mb-4">
                        <div class="card-header">
                            <div class="row">
                                <div class="col-8">
                                    <div class="d-inline-block" data-toggle="tooltip" data-placement="top"
                                         title="Tooltip">
                                    <span class="card-title">
                                        {{ 'product_review.admin.product_review_edit.review_detail'|trans() }}
                                    </span>
                                    </div>
                                </div>
                                <div class="col-4 text-right">
                                    <a data-toggle="collapse" href="#basicConfig" aria-expanded="false"
                                       aria-controls="basicConfig">
                                    </a>
                                </div>
                            </div>
                        </div>

                        <div class="collapse show ec-cardCollapse" id="basicConfig">
                            <div class="card-body">
                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ 'product_review.admin.product_review_edit.product_name'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        <div>{{ Product.name }}</div>
                                    </div>
                                </div>

                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ 'product_review.admin.product_review_edit.posted_date'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ ProductReview.create_date|date_min }}
                                    </div>
                                </div>

                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ '投稿者'|trans }}</span>
                                        <span class="badge badge-primary ml-1">{{ 'product_review.common.required'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.reviewer_name) }}
                                        {{ form_errors(form.reviewer_name) }}
                                    </div>
                                </div>
                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ 'URL'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.reviewer_url) }}
                                        {{ form_errors(form.reviewer_url) }}
                                    </div>
                                </div>
                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ '性別'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.sex) }}
                                        {{ form_errors(form.sex) }}
                                    </div>
                                </div>

                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ 'おすすめレベル'|trans }}</span>
                                        <span class="badge badge-primary ml-1">{{ 'product_review.common.required'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.recommend_level) }}
                                        {{ form_errors(form.recommend_level) }}
                                    </div>
                                </div>

                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ 'タイトル'|trans }}</span>
                                        <span class="badge badge-primary ml-1">{{ 'product_review.common.required'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.title) }}
                                        {{ form_errors(form.title) }}
                                    </div>
                                </div>

                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ 'コメント'|trans }}</span>
                                        <span class="badge badge-primary ml-1">{{ 'product_review.common.required'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.comment, {'attr': {'rows': '6'}}) }}
                                        {{ form_errors(form.comment) }}
                                    </div>
                                </div>

                                <div class="row mb-2">
                                    <div class="col-3">
                                        <span>{{ 'お店からの返信'|trans }}</span>
                                    </div>
                                    <div class="col">
                                        {{ form_widget(form.reply, {'attr': {'rows': '6'}}) }}
                                        {{ form_errors(form.reply) }}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="c-conversionArea">
            <div class="c-conversionArea__container">
                <div class="row justify-content-between align-items-center">
                    <div class="col-6">
                        <div class="c-conversionArea__leftBlockItem">
                            <a class="c-baseLink"
                               href="{{ url('product_review_admin_product_review_page', { resule: 1 }) }}"><i
                                        class="fa fa-backward"
                                        aria-hidden="true"></i><span>{{ 'product_review.admin.product_review_edit.conversion.back'|trans }}</span></a>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="row align-items-center justify-content-end">
                            <div class="col-auto">
                                {{ form_widget(form.Status) }}
                                {{ form_errors(form.Status) }}
                            </div>
                            <div class="col-auto">
                                <button class="btn btn-ec-conversion px-5"
                                        type="submit">{{ 'product_review.admin.product_review_edit.conversion.save'|trans }}</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

{% endblock %}
